package cn.iocoder.yudao.module.ai.dal.mysql.operationequ;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ai.dal.dataobject.operationequ.OperationEquDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ai.controller.admin.operationequ.vo.*;

/**
 * 运营中心-算力设备 Mapper
 *
 * @author 侯俊青
 */
@Mapper
public interface OperationEquMapper extends BaseMapperX<OperationEquDO> {

    default PageResult<OperationEquDO> selectPage(OperationEquPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OperationEquDO>()
                .eqIfPresent(OperationEquDO::getFromMessageId, reqVO.getFromMessageId())
                .eqIfPresent(OperationEquDO::getFromMessageIndex, reqVO.getFromMessageIndex())
                .inIfPresent(OperationEquDO::getCompanyId, reqVO.getCompanyIds())
                .likeIfPresent(OperationEquDO::getEquipmentDesc, reqVO.getEquipmentDesc())
                .likeIfPresent(OperationEquDO::getIp, reqVO.getIp())
                .eqIfPresent(OperationEquDO::getCpuTemperature, reqVO.getCpuTemperature())
                .eqIfPresent(OperationEquDO::getCpuLoad, reqVO.getCpuLoad())
                .eqIfPresent(OperationEquDO::getMem, reqVO.getMem())
                .eqIfPresent(OperationEquDO::getDisk, reqVO.getDisk())
                .eqIfPresent(OperationEquDO::getGpuList, reqVO.getGpuList())
                .eqIfPresent(OperationEquDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(OperationEquDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(OperationEquDO::getSuplierId, reqVO.getSuplierId())
                .orderByDesc(OperationEquDO::getId));
    }

}